package main

import "fmt"

type Student struct {
	name string
	age  int
}

func main() {
	i := make([]interface{}, 4)
	i[0] = 1
	i[1] = "hello go"
	i[2] = Student{"xdc", 1}
	i[3] = 1.2

	for _, data := range i {
		switch value := data.(type) {
		case int:
			fmt.Println("是int, 值为：", value)
		case string:
			fmt.Println("是string, 值为：", value)
			//fallthrough   Cannot fallthrough in type switch
		case Student:
			fmt.Println("是Student, 值为：", value)
		default:
			fmt.Println("不在switch中, 值为：", value)

		}
	}
}
